home *** CD-ROM | disk | FTP | other *** search
/ NBC Slam Jams! / NBC Slam Jams!.iso / xtras / media_la / effector.cst / 00048_Script_Drag Around < prev    next >
Text File  |  1997-09-30  |  1KB  |  46 lines

  1. --Drag Around
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Property partner,partnerExists
  8.  
  9. on getPropertyDescriptionList
  10.   set pList=[:]
  11.   addProp pList,#partner,[format:#integer,¼
  12.                              comment:"Also Drag Sprite#:",¼
  13.                              Default:0]
  14.   
  15.   return pList
  16. end
  17.  
  18. on beginSprite me
  19.   set partnerExists=((partner >0) and (partner<121))
  20. end
  21.  
  22. on mouseDown me
  23.   dragAround(me)
  24. end
  25.  
  26. on dragAround me
  27.   set s=the spriteNum of me
  28.   set offH = the mouseH - the locH of sprite s
  29.   set offV = the mouseV - the locV of sprite s
  30.   if partnerExists then
  31.     set offH2= the mouseH - the locH of sprite partner
  32.     set offV2= the mouseV - the locV of sprite partner
  33.   end if
  34.   repeat while the mouseDown
  35.     set mh=the mouseH
  36.     set mv=the mouseV
  37.     set the locH of sprite s=mh - offH
  38.     set the locV of sprite s=mv - offV
  39.     if partnerExists then
  40.       set the locH of sprite partner = mh - offH2
  41.       set the locV of sprite partner = mv - offV2
  42.     end if
  43.     updateStage
  44.   end repeat
  45. end
  46.